<ResourceDictionary
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
    
    xmlns:ctrls="clr-namespace:BreadcrumbLib.Controls"
    xmlns:bc="clr-namespace:BreadcrumbLib.Controls"
    xmlns:conv="clr-namespace:BreadcrumbLib.Converters"

    xmlns:themes="clr-namespace:BreadcrumbLib.Themes"
    >
	<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/BreadcrumbLib;component/Themes/Default/Brushes.xaml" />

		<ResourceDictionary>
			<conv:BoolToVisibilityCollapsedConverter x:Key="btvc" />
		</ResourceDictionary>
	</ResourceDictionary.MergedDictionaries>

	<Style TargetType="{x:Type ctrls:HotTrack}">
		<Setter Property="SelectedBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.HotTrack_SelectedBrush}}" />
		<Setter Property="BackgroundBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.HotTrack_BackgroundBrush}}" />
		<Setter Property="HighlightBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.HotTrack_HighlightBrush}}" />
		<Setter Property="ThreeDStyle" Value="{DynamicResource {x:Static themes:ResourceKeys.ThreeDStyleBrushes}}" />
		<Setter Property="Template">

			<Setter.Value>
				<ControlTemplate TargetType="ctrls:HotTrack">
					<Border x:Name="borderCurrent" 
                  CornerRadius="{TemplateBinding CornerRadius}"
                  BorderThickness="{TemplateBinding BorderThickness}" 
                  BorderBrush="Transparent"
									Background="Transparent">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="State_Normal" >
									<!--<Storyboard>
                            <ObjectAnimationUsingKeyFrames 
                                            Storyboard.TargetName="borderCurrent"
                                            Storyboard.TargetProperty="BorderBrush" Duration="0:0:0.1">
                                <DiscreteObjectKeyFrame KeyTime="0:0:0" 
                                Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type bc:HotTrack},
                                    Mode=FindAncestor}, Path=SelectedBorderBrush}" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>-->
								</VisualState>
								<VisualState x:Name="State_MouseOver">
									<Storyboard>
										<!--<ColorAnimation  
                                Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" 
                                Storyboard.TargetName="borderCurrent" Duration="0" To="Black" />-->

										<DoubleAnimation Storyboard.TargetName="PART_Background"  Duration="0:0:0.1" Storyboard.TargetProperty="Opacity"  To="1" />
										<DoubleAnimation Storyboard.TargetName="PART_Highlight"  Duration="0:0:0.1"  Storyboard.TargetProperty="Opacity"  To="1" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="State_MouseOverGrayed">
									<Storyboard>
										<!--<ColorAnimation  
                                Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" 
                                Storyboard.TargetName="borderCurrent" Duration="0" To="Black" />-->

										<DoubleAnimation Storyboard.TargetName="PART_Background"  Duration="0:0:0.1" Storyboard.TargetProperty="Opacity"  To="0.015" />
										<DoubleAnimation Storyboard.TargetName="PART_Highlight"  Duration="0:0:0.1"  Storyboard.TargetProperty="Opacity"  To="0.05" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="State_Dragging">
									<Storyboard>
										<DoubleAnimation Storyboard.TargetName="PART_Background"  Duration="0:0:0.1" Storyboard.TargetProperty="Opacity"  To="0.05" />
										<DoubleAnimation Storyboard.TargetName="PART_Highlight"  Duration="0:0:0.1"  Storyboard.TargetProperty="Opacity"  To="0.35" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="State_DraggingOver">
									<Storyboard>
										<DoubleAnimation Storyboard.TargetName="PART_Background"  Duration="0:0:0.1" Storyboard.TargetProperty="Opacity"  To="0.05" />
										<DoubleAnimation Storyboard.TargetName="PART_Highlight"  Duration="0:0:0.1"  Storyboard.TargetProperty="Opacity"  To="0.35" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="State_Selected">
									<Storyboard>
										<DoubleAnimation Storyboard.TargetName="PART_Selected"  Duration="0:0:0.1"   Storyboard.TargetProperty="Opacity"  To="1" />
										<DoubleAnimation Storyboard.TargetName="PART_Highlight"  Duration="0:0:0.1"  Storyboard.TargetProperty="Opacity"  To="1" />
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<!--<VisualStateGroup x:Name="FocusedStates">
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="PART_HotTrackGrid"  Duration="0:0:0.1"
                                             Storyboard.TargetProperty="Opacity"  To="1" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Unfocused" >
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="PART_HotTrackGrid"  Duration="0:0:0.1"
                                             Storyboard.TargetProperty="Opacity"  To="0.5" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="PointerFocused" />
                </VisualStateGroup>-->

						</VisualStateManager.VisualStateGroups>

						<Grid>
							<Grid x:Name="PART_HotTrackGrid">
								<Grid.RowDefinitions>
									<RowDefinition MaxHeight="15"/>
									<RowDefinition/>
								</Grid.RowDefinitions>

								<Rectangle x:Name="PART_Selected" Opacity="0"   Fill="{TemplateBinding SelectedBrush}" Grid.RowSpan="2" />
                                <Rectangle x:Name="PART_Background" Opacity="0" Fill="{TemplateBinding BackgroundBrush}" Grid.RowSpan="2" />
                                <Rectangle x:Name="PART_Highlight"  Opacity="0" Fill="{TemplateBinding HighlightBrush}"  />
							</Grid>
							<Rectangle Visibility="{Binding FillFullRow, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource btvc}}">
								<Rectangle.Fill>
									<VisualBrush Stretch="Uniform" Visual="{Binding ElementName=PART_HotTrackGrid}"  />
								</Rectangle.Fill>
								<Rectangle.RenderTransform>
									<ScaleTransform ScaleX="-1" />
								</Rectangle.RenderTransform>
							</Rectangle>
							<Border Padding="{TemplateBinding Padding}" Grid.RowSpan="2">
								<ContentPresenter x:Name="content" Content="{TemplateBinding Content}"  />
							</Border>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="ThreeDStyle" Value="False">
							<Setter TargetName="PART_Highlight" Property="Grid.RowSpan" Value="2" />
						</Trigger>
						<Trigger Property="ThreeDStyle" Value="True">
							<Setter TargetName="PART_Highlight" Property="Grid.RowSpan" Value="1" />
						</Trigger>

						<Trigger Property="IsSelected" Value="True">
							<Setter TargetName="borderCurrent" Property="BorderBrush"
							        Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type ctrls:HotTrack},Mode=FindAncestor}, Path=SelectedBorderBrush}" />

							<!--<Setter TargetName="PART_Selected"   Property="Fill" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonSelectedColor}}" />
							<Setter TargetName="PART_Background" Property="Fill" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonBackgoundColor}}" />
							<Setter TargetName="PART_Highlight" Property="Fill" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonBackgoundColor}}" />
							<Setter TargetName="PART_HotTrackGrid" Property="Background" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonSelectedColor}}" />-->
						</Trigger>

						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="borderCurrent"
							        Property="BorderBrush"
											Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type bc:HotTrack}, Mode=FindAncestor}, Path=SelectedBorderBrush}" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

</ResourceDictionary>